package com.itheima.health.controller;

import com.itheima.health.common.MessageConst;
import com.itheima.health.entity.Result;
import com.itheima.health.pojo.Setmeal;
import com.itheima.health.service.MemberService;
import com.itheima.health.service.SetMealService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author ：石破天
 * @date ：Created in 2022年06月07日
 * @description ：
 * @version: 1.0
 */
@RestController
@RequestMapping("/mobile/setmeal")
@Slf4j
@Api(tags = "手机端套餐接口")
public class MobileSetMealController {
    @Autowired
   private SetMealService setMealService;


    // 11_手机端_体检预约_套餐展示
    @GetMapping("/getSetmeal")
    public Result getSetmeal(){
        log.info("手机端_体检预约_套餐展示");
        List<Setmeal> setmealList = setMealService.getSetmeal();
        return new Result(true,MessageConst.ACTION_SUCCESS,setmealList);

    }

//    13_手机端_体检预约_套餐详情查看
    @GetMapping("/findById")
    public Result findByIdmobile(@RequestParam Integer id){
        log.info("手机端_体检预约_套餐详情查看的id{},id");
        Setmeal s= setMealService.findById(id);
        return new Result(true,MessageConst.ACTION_SUCCESS,s);
    }

}
